% esiply.tex - Documation for SPAM game.
% Copyright (C) 2007 Richard Uhler
% This file is part of Esiply.
%
% Esiply is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License, Version 2,
% as published by the Free Software Foundation.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program.  If not, see <http://www.gnu.org/licenses/>.

\documentclass[titlepage]{article}
\pagestyle{headings}
\newcommand{\esiply}[0]{Esiply}
\begin{document}
\title{Esiply}
\author{Richard Uhler}
\date{\today}
\maketitle
\tableofcontents
\pagebreak
\section{About This Document}
This document describes all aspects of \esiply. It includes general info
information about \esiply, how to use it, what its good for, what it's goals
are, and more of that sort of thing. It also describes the implementation of
\esiply, along with a detailed description of all its classes and reasons for
certain design decisions. The hope is that you can read this one document
through and get a solid understanding of all of \esiply.

Please keep in mind while reading this, however, that it is just a snapshot of
where \esiply was at when this documentation was created. It is very difficult
to keep documentation up to date. If ever there is conflict, the source code
is always right.

\section{Esiply Object}
Throughout the standard javascript library implementation are references to
the Esiply object. The Esiply object gives javascript access to \esiply
internals which it can't get through pure javascript. The goal is to move any
implementation dependant functionality to the Esiply Object, and have the rest
of the standard library implemented with standard compliant javascript, making
use of the Esiply object only where necessary.
\section{Native Interface}
One big problem javascript has as a language is its inability to do any input
or output on its own, along with a lack of any standardized native interface.
This makes it really hard to write any ``real'' javascript programs. You have
no standard way of separating programs into different files. You have no
standard way of reading or writing files. You have no standard way of
accessing the existing functionality provided in libraries not written in
javascript.

To fix that \esiply has designed its own Native Interface to be simple and
implementation independent. The hope is that \esiply's native interface may be
used as a prototype standard javascript native interface. In the worst case,
it shouldn't be hard for anyone who wants to to implement the interface for
the other javascript interpreters. With that, you can now have confidence that
your javascript program will be portable across interpreters.

\section{Coding Style}
In order to maintain a clean code base for \esiply, the coding style must be
consistent throughout the code. The following guidelines should be followed.
These guidelines are the result of the author's experiences with writing code.
If you disagree with any of them, you are welcome to suggest alternatives
along with a description of why you think the code would be cleaner and easier
to be maintained with those alternatives. But until you have suggested an
alternative which has been accepted, stick to these.

\subsection{Including Files}
When including header files, first include standard library files
alphabetically, then include local header files alphabetically. Leave one
empty line between the two groups.

We split the standard library files, indicated with angle brackets, from the
local include files, indicated with double quotes, because it makes it look
pretty. We alphabetize the two groups so it is easy to see if we are including
a header file, and to enforce the fact that it should not matter what order
they are included in. If it does matter what order headers are included in,
you've messed up somewhere and should fix it.

Here is an example of how it should be done.
\begin{verbatim}
#include <math.h>
#include <stdlib.h>

#include "bar.h"
#include "foo.h"
\end{verbatim}

\end{document}

